#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2019/11/28 12:06|12:06
# @Author  : yangdingyi
# @File    : 反转字符串
# @Software: PyCharm
from typing import List


class Solution:
    def reverseString(self, s: List[str]) -> None:
        """
        Do not return anything, modify s in-place instead.
        """
        # i, j = 0, len(s)-1
        # while i < j:
        #     s[i], s[j] = s[j], s[i]
        #     i, j = i + 1, j - 1
        # return s

        def work(ss: List[str]):
            if not ss:
                return
            key = ss.pop(0)
            work(ss)
            ss.append(key)
            return
        work(s)

        # def work(ss: List[str]) -> None:


solve = Solution()

s = ["h", "e", "l", "l", "o"]
print(s)
print(solve.reverseString(s))
print(s)
